<!DOCTYPE html>
<html lang="zh">
<head>
    <th:block th:include="include :: header('卡片列表')" />
</head>
<body class="gray-bg">

<div class="wrapper wrapper-content animated fadeInRight">
    <form id="form-user-add" class="form-horizontal">
        <h4 class="form-header h4">
            最新通知公告
        </h4>
    </form>

    <div class="row" id="loanList" style="margin-left: -5px">
    </div>
</div>
<th:block th:include="include :: footer" />
<script>
    $(function() {
        let view = $('#loanList');

        $.ajax({
            url:ctx + 'system/notice/listMain',
            type:'post',
            dataType:'json',
            success: function(result) {
                result.rows.map( item => {
                    let str = '';
                    if (item.noticeType == 1) {
                        str =  '<span class="label label-primary pull-right" style="background-color: #510080; font-size: 15px; cursor: pointer">通知</span>\n';
                    } else if (item.noticeType == 2){
                        str ='<span class="label label-primary pull-right" style="background-color: #ad0404; font-size: 15px; cursor: pointer">公告</span>\n';
                    }

                    view.append('<div class="col-sm-7">\n' +
                        '<div class="ibox"><div class="ibox-title">\n' + str +
                        '<h5>编号：'+ item.noticeId +'</h5></div>\n' +
                        '<div class="ibox-content"><h4>公告信息: </h4><div>\n' +
                        '<div class="row  m-t-sm"><div class="col-sm-4"><img class="img img-md" src="/img/bike.png"/></div>'+
                        '<div class="col-sm-6">'+ item.noticeTitle +'</div>'+
                        '<div class="col-sm-6">'+ item.noticeContent +'</div></div>\n' +
                        '<h4></h4><div>\n' +
                        '<div class="form-header h4"></div>'+
                        '<div class="row  m-t-sm">\n' +
                        '<div class="col-sm-4"><div class="font-bold">创建人</div>'+ item.createBy +'</div>\n' +
                        '<div class="col-sm-4"><div class="font-bold">创建日期</div>'+ item.createTime +'</div>\n' +
                        '<div class="col-sm-4 text-right"><div class="font-bold">更新日期</div>'+ item.updateTime +'</div></div>\n' +
                        '</div></div>');
                });
            }
        });
    });
</script>
</body>
</html>
